<template>
  <!-- 调整 -->
  <w-container ref="container" class="content">
    <w-query-search
      ref="search"
      authority-key="product"
      page-name="调整"
      :query-items="queryItems"
      :label-width="'60'"
      @query="handleQuery"
    />
    <w-table
      ref="table"
      :page-size="pageSize"
      :current-page="currentPage"
      :total-recored="totalRecored"
      :table-items="tableItemList"
      :tab-data="list"
      :is-heigth="true"
      @handleSizeChange="handleSizeChange"
      @handleCurrentChange="handleCurrentChange"
    />
  </w-container>
</template>
<script>
import mixin from '../mixin/common'
import { getOrderList } from '@/api/order'
export default {
  mixins: [mixin],
  data() {
    return {
      list: [],
      queryItems: [
        { label: '支付时间', type: 'datetimerange', value: [], key: 'date', noTime: true },
        { label: '交易单号/商户单号', placeholder: '请输入', value: '', key: 'goodsAttrName' },
        { label: '来源词', placeholder: '请输入', value: '', key: 'goodsName' },
        { label: '状态', type: 'select', value: '', key: 'businessPlateCode', options: { label: 'name', value: 'code', list: [] }}
      ],
      tableItemList: [
        { label: '交易单号', prop: 'tradeNo', width: 200, align: 'left' },
        { label: '商户单号', prop: 'tradeOrderNo', width: 200, align: 'left' },
        { label: '支付价格/元', prop: 'payAmount', width: 90, align: 'left' },
        { label: '支付时间', prop: 'updateTime', width: 160, align: 'left' },
        { label: '商品名称', prop: 'goodsName', width: 140, align: 'left' },
        { label: '渠道来源', prop: 'channel', width: 140, align: 'left' },
        { label: '来源词', prop: 'remark', width: 80, align: 'left' },
        { label: '当前状态', prop: 'payStatus', width: 80, align: 'left' },
        { label: '操作', prop: 'goodsSepcName', width: 180, align: 'left' }
      ]
    }
  },
  mounted() {
    this.handleQuery()
  },
  methods: {
    // 初始化
    async loadData(val) {
      const result = await getOrderList(val)
      if (result.code === '0') {
        this.list = result.data.records || []
        this.totalRecored = result.data.total
        return
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.btn {
  text-align: center;
}
</style>
